Add a stub for the no-Xcursor case. (noticed by Luis Villa)
authorMatthias Clasen <mclasen@redhat.com>
Tue, 14 Jun 2005 20:43:20 +0000 (20:43 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 14 Jun 2005 20:43:20 +0000 (20:43 +0000)
2005-06-14  Matthias Clasen  <mclasen@redhat.com>

* gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_name): Add a
stub for the no-Xcursor case. (noticed by Luis Villa)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gdk/x11/gdkcursor-x11.c

index ee7412579805e7f90a04a1f9fdfbff344a9f2733..c620755c1b02dfc1aac2feda7ec31d8b385b3a1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-06-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_name): Add a 
+       stub for the no-Xcursor case. (noticed by Luis Villa)
+
        Use named cursors for the DND cursors, the names are "dnd-none",
        "dnd-copy", "dnd-link", "dnd-move" and "dnd-ask". Also use an RGBA 
        cursor instead of cursor+window when possible. This saves 
index ee7412579805e7f90a04a1f9fdfbff344a9f2733..c620755c1b02dfc1aac2feda7ec31d8b385b3a1f 100644 (file)
@@ -1,5 +1,8 @@
 2005-06-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_name): Add a 
+       stub for the no-Xcursor case. (noticed by Luis Villa)
+
        Use named cursors for the DND cursors, the names are "dnd-none",
        "dnd-copy", "dnd-link", "dnd-move" and "dnd-ask". Also use an RGBA 
        cursor instead of cursor+window when possible. This saves 
index ee7412579805e7f90a04a1f9fdfbff344a9f2733..c620755c1b02dfc1aac2feda7ec31d8b385b3a1f 100644 (file)
@@ -1,5 +1,8 @@
 2005-06-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_name): Add a 
+       stub for the no-Xcursor case. (noticed by Luis Villa)
+
        Use named cursors for the DND cursors, the names are "dnd-none",
        "dnd-copy", "dnd-link", "dnd-move" and "dnd-ask". Also use an RGBA 
        cursor instead of cursor+window when possible. This saves 
index b9c27fe2a02154f222307ae8848ab9e0aeb75375..3373ecdcfb4e9064bb21d5ec11d80b0258fd1540 100644 (file)
@@ -312,6 +312,34 @@ gdk_cursor_get_display (GdkCursor *cursor)
 
 #if defined(HAVE_XCURSOR) && defined(HAVE_XFIXES) && XFIXES_MAJOR >= 2
 
+#if 0
+XcursorComments *
+load_comments (const char       *file, 
+              const char       *theme)
+{
+    FILE           *f = 0;
+    XcursorImages   *images = 0;
+    XcursorComments *comments = 0;
+
+    if (theme)
+       f = XcursorScanTheme (theme, file);
+    if (!f)
+      f = XcursorScanTheme ("default", file);
+    if (f == XCURSOR_SCAN_CORE)
+      return 0;
+    if (f)
+      {
+       XcursorFileLoad (f, &comments, &images);
+       fclose (f);
+
+       if (images)
+         XcursorImagesDestroy (images);
+      }
+
+    return comments;
+}
+#endif
+
 /**
  * gdk_cursor_get_image:
  * @cursor: a #GdkCursor
@@ -333,13 +361,15 @@ gdk_cursor_get_image (GdkCursor *cursor)
   GdkCursorPrivate *private;
   XcursorImages *images = NULL;
   XcursorImage *image;
+  XcursorComments *comments;
   Atom atom;
   gint size;
   gchar buf[32];
   guchar *data;
   GdkPixbuf *pixbuf;
   gchar *theme;
-
+  gint i, j;
+  
   g_return_val_if_fail (cursor != NULL, NULL);
 
   private = (GdkCursorPrivate *) cursor;
@@ -376,7 +406,30 @@ gdk_cursor_get_image (GdkCursor *cursor)
   gdk_pixbuf_set_option (pixbuf, "x_hot", buf);
   g_snprintf (buf, 32, "%d", image->yhot);
   gdk_pixbuf_set_option (pixbuf, "y_hot", buf);
-  
+
+#if 0
+  comments = load_comments (images->name, theme);
+
+  j = 0;
+  for (i = 0; i < comments->ncomment; i++)
+    {
+      switch (comments->comments[i].comment_type)
+       {
+       case XCURSOR_COMMENT_COPYRIGHT:
+         gdk_pixbuf_set_option (pixbuf, "copyright", comments->comments[i].comment);
+         break;
+       case XCURSOR_COMMENT_LICENSE:
+         gdk_pixbuf_set_option (pixbuf, "license", comments->comments[i].comment);
+         break;
+       default:
+         g_snprintf (buf, 32, "comment%d", j++);
+         gdk_pixbuf_set_option (pixbuf, buf, comments->comments[i].comment);
+         break;
+       }
+    }
+  XcursorCommentsDestroy (comments);
+#endif
+
   XcursorImagesDestroy (images);
 
   return pixbuf;
@@ -687,6 +740,15 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display,
   return cursor;
 }
 
+GdkCursor*  
+gdk_cursor_new_from_name (GdkDisplay  *display,
+                         const gchar *name)
+{
+  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+
+  return NULL;
+}
+
 gboolean 
 gdk_display_supports_cursor_alpha (GdkDisplay    *display)
 {